<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8" import="java.util.Date"%>
<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK"%>
<%@ include file="/pages/safeai/jsp/common/taglibs.jsp"%>
<%@ include file="/pages/safeai/jsp/common/meta.jsp"%>
<%
	Date d = new Date();
	Long time = d.getTime();
%>
<html>
	<head>
		<title>前台管理--文章信息管理--添加文章</title>
		<link href="${ctx}/css/safeai/together.css" rel="stylesheet"
			type="text/css">
	</head>

	<body>
		<form method="post" action="${ctx }/article/articleManage.do" name="articleForm" enctype="multipart/form-data" >
			<input type="hidden" name="method" value="insert" />
			<input type="hidden" name="article.atype" value="${article.atype}" />
			<input type="hidden" name="article.pid" value="11" />
			<input type="hidden" name="article.publisher"	value="${article.publisher}" />
			<input type="hidden" name="article.del" value="${article.del}" />
			<table align="center" width="700px">
				<tr>
					<th colspan="2">
						添加活动
					</th>
				<tr>
					<td class="td_01">
						标题：
					</td>
					<td class="td_edit">
						<input type="text" name="article.title" value="" />
					</td>
				</tr>
				<tr>
				<td nowrap class="td_01">图片</td>
					<td colspan="3" class="td_02">
					<a href="javaScript:void(0);"> <img height="80" src="${ctx}/${article.imagedesc}?time=<%=time%>" width="80" /></a>&nbsp;&nbsp;<span style="color:red;">注：图片尺寸： 500*500,格式为：.JPG,大小为：10Mb</span><br>
					<input type="file" value="${article.image1File}" name="article.image1File" onkeypress="alert('不允许手工填写'); window.event.returnValue=false;"/> 
					<input type="hidden" value="${article.imagedesc}" name="oldImage" /><br />
					<font color="red">${file1}</font>
					</td>
				</tr>
				<tr>
					<td class="td_01">
						简介：
					</td>
					<td class="td_edit">
						<textarea name="article.summaryinfo" cols="70" rows="5">${article.summaryinfo}</textarea>
					</td>
				</TR>
				<tr>
					<td class="td_01">
						顺序：
					</td>
					<td class="td_edit">
						<input type="text" name="article.sequence" value="0" id="sequence" onchange="testisNum('sequence')"/>
					</td>
				</TR>
				<tr>
					<td class="td_01">
						网站地址：
					</td>
					<td class="td_edit">
						<input type="text" name="article.urllink" value="${article.urllink }" />
					</td>
				</tr>
				<tr>
					<td class="td_01">
						原文地址：
					</td>
					<td class="td_edit">
						<input type="text" name="article.originalurllink" value="${article.originalurllink }" />
					</td>
				</tr>
				<tr>
					<td class="td_01">
						内容：
					</td>
					<td class="td_03">
					<FCK:editor id="article.content" basePath="${ctx}/FCKeditor/" width="90%" height="390px"
					defaultLanguage="zh-cn"  tabSpaces="8"
					imageBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
					linkBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
					flashBrowserURL="${ctx}/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
					imageUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
					linkUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
					flashUploadURL="${ctx}/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash">
  			</FCK:editor>
					</td>
				</TR>
				<tr>
					<td colspan="2" class="td_01">
						<input name="submit" class="btn" type="submit" value="提交">
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<input type="button" class="btn" name="return" value="返回" onmousedown="javascript:history.go(-1);" />
					</td>
				</TR>
			</table>
		</form>

	</body>
	<script type="text/javascript">
	
	 function testisNum(id){
	 var object=document.getElementById(id);
      var s =document.getElementById(object.id).value;
          if(s!=""){
             if(isNaN(s)){
                 alert("请输入数字");
                 object.value=0;
			object.focus();
                 return;
             }
          }else{
                 alert("此处不能为空！默认值为0！");
                 object.value=0;
			object.focus();
                 return;
          }
   }
      //获得内容控件
      var objContent=document.getElementById("article.content");
   objContent.onchange=function(){ 
   			var str=objContent.value; 
			str=bb(aa(str)); 
			objContent.value=str; 
	}
  function aa(str){
        returnstr.replace(/^[\s]+/,"");   
  }     
  function bb(str){
        returnstr.replace(/[\s]+$/,"");
  }  
</script>


</html>
